package com.hl.card.credit.utill;

import com.hl.card.credit.pub.model.PublicOrdersAllModel;
import com.hl.card.credit.pub.utils.DateUtils;

import java.util.Date;
import java.util.Random;

public class CommonUtil {

    public static String genOrderCode(PublicOrdersAllModel allModel){
        String str=allModel.getBusines_species()+allModel.getPolicy_name()+allModel.getBusiness_type();
        Random r = new Random();
        int num=r.nextInt(200);

        String zero="";
        if(num<100&&num>9)
            zero="0";
        if(num<10)
            zero="00";
        String timestr= DateUtils.DateToStr(new Date(),"yyyyMMddHHmmss");
        String codeStr=str.toUpperCase()+timestr+zero+num;
        return codeStr;
    }
}
